package com.esri.core.map;

import com.esri.core.internal.util.d;
import com.esri.core.map.TimeOptions;
import java.io.IOException;
import java.util.GregorianCalendar;
import org.codehaus.jackson.JsonParseException;
import org.codehaus.jackson.JsonParser;
import org.codehaus.jackson.JsonToken;

/* loaded from: classes.dex */
public class TimeInfo {
    private String a;
    private String b;
    private String c;
    private TimeExtent d;
    private TimeReference e;
    private int f;
    private TimeOptions.Units g = TimeOptions.Units.Unknown;
    private TimeOptions h;

    public String getStartTimeField() {
        return this.a;
    }

    public String getEndTimeField() {
        return this.b;
    }

    public String getTrackIdField() {
        return this.c;
    }

    public TimeExtent getTimeExtent() {
        return this.d;
    }

    public TimeReference getTimeReference() {
        return this.e;
    }

    public int getTimeInterval() {
        return this.f;
    }

    public TimeOptions.Units getTimeIntervalUnits() {
        return this.g;
    }

    public TimeOptions getExportOptions() {
        return this.h;
    }

    public static TimeInfo fromJson(JsonParser jsonParser) throws JsonParseException, IOException {
        if (jsonParser.getCurrentToken() != JsonToken.START_OBJECT) {
            return null;
        }
        TimeInfo timeInfo = new TimeInfo();
        while (jsonParser.nextToken() != JsonToken.END_OBJECT) {
            String currentName = jsonParser.getCurrentName();
            jsonParser.nextToken();
            if ("startTimeField".equals(currentName)) {
                if (jsonParser.getCurrentToken() != JsonToken.VALUE_NULL) {
                    timeInfo.a = jsonParser.getText();
                }
            } else if ("endTimeField".equals(currentName)) {
                if (jsonParser.getCurrentToken() != JsonToken.VALUE_NULL) {
                    timeInfo.b = jsonParser.getText();
                }
            } else if ("trackIdField".equals(currentName)) {
                if (jsonParser.getCurrentToken() != JsonToken.VALUE_NULL) {
                    timeInfo.c = jsonParser.getText();
                }
            } else if ("timeExtent".equals(currentName)) {
                long[] m = d.m(jsonParser);
                if (m != null && m.length == 2) {
                    GregorianCalendar gregorianCalendar = new GregorianCalendar();
                    GregorianCalendar gregorianCalendar2 = new GregorianCalendar();
                    gregorianCalendar.setTimeInMillis(m[0]);
                    gregorianCalendar2.setTimeInMillis(m[1]);
                    timeInfo.d = new TimeExtent(gregorianCalendar, gregorianCalendar2);
                }
            } else if ("timeReference".equals(currentName)) {
                if (jsonParser.getCurrentToken() != JsonToken.VALUE_NULL) {
                    timeInfo.e = TimeReference.fromJson(jsonParser);
                }
            } else if ("timeInterval".equals(currentName)) {
                if (jsonParser.getCurrentToken() != JsonToken.VALUE_NULL) {
                    timeInfo.f = jsonParser.getIntValue();
                }
            } else if ("timeIntervalUnits".equals(currentName)) {
                if (jsonParser.getCurrentToken() != JsonToken.VALUE_NULL) {
                    timeInfo.g = TimeOptions.Units.fromString(jsonParser.getText());
                }
            } else if ("exportOptions".equals(currentName)) {
                timeInfo.h = TimeOptions.fromJson(jsonParser);
            } else {
                jsonParser.skipChildren();
            }
        }
        return timeInfo;
    }

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj != null && getClass() == obj.getClass()) {
            TimeInfo timeInfo = (TimeInfo) obj;
            if (this.a.equals(timeInfo.a) && this.b.equals(timeInfo.b) && this.c.equals(timeInfo.c)) {
                TimeExtent timeExtent = this.d;
                if (timeExtent == null) {
                    if (timeInfo.d != null) {
                        return false;
                    }
                } else if (!timeExtent.equals(timeInfo.d)) {
                    return false;
                }
                TimeReference timeReference = this.e;
                if (timeReference == null) {
                    if (timeInfo.e != null) {
                        return false;
                    }
                } else if (!timeReference.equals(timeInfo.e)) {
                    return false;
                }
                if (this.f == timeInfo.f && this.g.equals(timeInfo.g)) {
                    TimeOptions timeOptions = this.h;
                    if (timeOptions == null) {
                        if (timeInfo.h != null) {
                            return false;
                        }
                    } else if (!timeOptions.equals(timeInfo.h)) {
                        return false;
                    }
                    return true;
                }
                return false;
            }
            return false;
        }
        return false;
    }

    public int hashCode() {
        String str = this.a;
        int hashCode = ((str == null ? 0 : str.hashCode()) + 31) * 31;
        String str2 = this.b;
        int hashCode2 = (hashCode + (str2 == null ? 0 : str2.hashCode())) * 31;
        String str3 = this.c;
        int hashCode3 = (hashCode2 + (str3 == null ? 0 : str3.hashCode())) * 31;
        TimeExtent timeExtent = this.d;
        int hashCode4 = (hashCode3 + (timeExtent == null ? 0 : timeExtent.hashCode())) * 31;
        TimeReference timeReference = this.e;
        int hashCode5 = (((hashCode4 + (timeReference == null ? 0 : timeReference.hashCode())) * 31) + this.f) * 31;
        TimeOptions.Units units = this.g;
        int hashCode6 = (hashCode5 + (units == null ? 0 : units.hashCode())) * 31;
        TimeOptions timeOptions = this.h;
        return hashCode6 + (timeOptions != null ? timeOptions.hashCode() : 0);
    }

    public String toString() {
        return "TimeInfo [startTimeField=" + this.a + ", endTimeField=" + this.b + ", trackIdField=" + this.c + ", timeExtent=" + this.d + ", timeReference=" + this.e + ", timeInterval=" + this.f + ", timeIntervalUnits=" + this.g + ", exportOptions=" + this.h;
    }
}
